﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Peninsula.DataAccess.POCO;
using Peninsula.Utility.Extensions;

namespace Peninsula.Services
{
    public class ItemTypeService : BaseService<DataAccess.POCO.ItemType>, IServices.IItemTypeService
    {
        public bool DeleteById(string id)
        {
            return Delete(id) > 0;
        }

        public bool IsExitItemTyoe(ItemType itemType)
        {
            var exist = Get(i => i.Name == itemType.Name);
            return exist.IsNotNull() && !exist.Id.Equals(itemType.Id);
        }
    }
}
